<?php

class ActionMetals extends BaseAction
{
    public function run()
    {
        $this->template->aLotsMetals = LotMetal::model()->findAll(array('condition' => '(status = "active") AND (UNIX_TIMESTAMP() < UNIX_TIMESTAMP(date_expired))', 'order' => 'date_created DESC'));
        $this->template->bHasMetalsTariffPlans = !Yii::app()->user->isGuest() && (Yii::app()->user->isUserSoleProprietorship() || TariffPlan::hasActiveTariffPlans(Yii::app()->user->id));
    }
}